﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Bind();
            gvProduct.Visible = false;
        }


    }
    protected void Bind()
    {
        users us = new users();
        gvProduct.DataSource = us.Getone1(us);
        gvProduct.DataBind();   
    }
    protected void gvProduct_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        gvProduct.PageIndex = e.NewPageIndex;
        Bind();  //调用自定义方法Bind()
    }


    protected void imgbtnSearch_Click(object sender, ImageClickEventArgs e)
    {
        users us = new users();
        us.type = tbSeart.Text.Trim();
        gvProduct.DataSource = us.Getone1(us);
        gvProduct.DataBind();
        gvProduct.Visible = true;
    }
    protected void gvProduct_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {

    }
}